package br.ufmg.dcc.simulesspl.model;

import java.util.Random;

public class Sprint {
	
	private static Random random = new Random();
	
	private int code = 0;
	private int bugs = 0;
	private int bugFixes = 0;
	
	public void setDeveloper(EngineerCard engineer) {
		if(engineer == null) {
			return;
		}
		
		code = engineer.getVelocity();
		
		double p = engineer.getBugProbability();
		if(random.nextDouble() < p) {
			bugs = 1;
		}
	}
	
	public int getBugs() {
		return bugs;
	}
	
	public int getCode() {
		return code;
	}

	public void setBugFixer(EngineerCard engineer) {
		if(engineer == null) {
			return;
		}
		this.bugFixes = 1;
	}

	public int getBugFixes() {
		return bugFixes;
	}

}
